package client;

import client.InvestComPost_GUI;

import java.awt.BorderLayout;
import javax.naming.ConfigurationException;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.net.MalformedURLException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.awt.Font;
import java.awt.Color;

public class ApplySuc_GUI extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/**
	 * Launch the application.
	 *//*
	public static void main(String[] args) {
		try {
			ApplySuc_GUI dialog = new ApplySuc_GUI();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public ApplySuc_GUI() {
		setTitle("\u5E94\u8058\u6210\u529F");
		setModalityType(ModalityType.APPLICATION_MODAL);
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);

		JLabel label = new JLabel(
				"\u606D\u559C\uFF0C\u60A8\u5DF2\u7ECF\u6B63\u5F0F\u6210\u4E3A\u672C\u516C\u53F8\u804C\u5458\uFF01");
		label.setForeground(Color.RED);
		label.setFont(new Font("幼圆", Font.PLAIN, 18));
		label.setBounds(36, 36, 305, 43);
		contentPanel.add(label);

		JButton button = new JButton("\u8FDB\u5165\u516C\u53F8");
		button.setFont(new Font("宋体", Font.PLAIN, 15));
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (true)// 判断改公司职员是否已满
				{

					try {
						dispose();
						InvestComPost_GUI dialog;
						dialog = new InvestComPost_GUI();
						dialog.setLocationRelativeTo(null);
						dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
						dialog.setVisible(true);
					} catch (ConfigurationException e1) {
						e1.printStackTrace();
					} catch (RemoteException e1) {
						e1.printStackTrace();
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					} catch (NotBoundException e1) {
						e1.printStackTrace();
					}

				} else
					JOptionPane.showMessageDialog(null, "本公司职员已满！！");
			}
		});
		button.setBounds(96, 110, 100, 50);
		contentPanel.add(button);

		JButton button_1 = new JButton("\u79BB\u5F00\u516C\u53F8");
		button_1.setFont(new Font("宋体", Font.PLAIN, 15));
		button_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		button_1.setBounds(228, 110, 100, 50);
		contentPanel.add(button_1);

	}
}
